/*
 * Copyright (C) 2012, EADS France
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
package xowl.interpreter;

/**
 *
 * @author Laurent WOUTERS
 */
public class Hook {
    public static interface Call {
        Object execute(Thread thread, Object[] parameters);
    }
    
    private xowl.lang.runtime.Entity entity;
    private int paramsCount;
    private boolean hasReturns;
    private Call callback;
    
    public xowl.lang.runtime.Entity getEntity() { return entity; }
    public int getParametersCount() { return paramsCount; }
    public boolean hasReturn() { return hasReturns; }
    public Call getCallback() { return callback; }
    
    public Hook(xowl.lang.runtime.Entity entity, int pcount, boolean returns, Call callback) {
        this.entity = entity;
        this.paramsCount = pcount;
        this.hasReturns = returns;
        this.callback = callback;
    }
}
